namespace FluentTests.Framework.VerbExtensions
{
    internal class NumberAssertion
    {
        internal static void GreaterThan(double actualValue, double compareValue, bool negated, IAssertionProvider assertion)
        {
            var isGreater = actualValue > compareValue;
            if (isGreater && negated)
                assertion.Fail("The actual value of {0} is greater than {1}", actualValue, compareValue);
            if (!isGreater && !negated)
                assertion.Fail("The actual value of {0} is less or equal than {1}", actualValue, compareValue); 
        }

        internal static void LessThan(double actualValue, double compareValue, bool negated, IAssertionProvider assertion)
        {
            var isLess = actualValue < compareValue;
            if (isLess && negated)
                assertion.Fail("The actual value of {0} is less than {1}", actualValue, compareValue);
            if (!isLess && !negated)
                assertion.Fail("The actual value of {0} is greater than or equal to {1}", actualValue, compareValue);
        }

        internal static void Zero(double actualValue, bool negated, IAssertionProvider assertion)
        {
            var isZero = actualValue == 0;
            if (isZero && negated)
                assertion.Fail("The actual value of {0} is not 0 (zero)", actualValue);
            if (!isZero && !negated)
                assertion.Fail("The actual value of {0} is 0 (zero)", actualValue);
        }
    }
}